package com.bgs.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bgs.pojo.Detailed;
import com.bgs.pojo.Money;
import com.bgs.pojo.ResumePicture;
import com.bgs.pojo.Social;
import com.bgs.service.DetailedService;
import com.bgs.service.MoneyService;
import com.bgs.service.SocialService;
import com.bgs.tool.R;
import com.bgs.utils.LocaldatetimeUtils;
import com.bgs.vo.MoneyVo;
import com.bgs.vo.SocialVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 社保表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-05-08
 */
@CrossOrigin
@RestController
@RequestMapping("/social")
public class SocialController {

    @Autowired
    private SocialService socialService;


    @ApiOperation(value = "所有社保表列表")
    @GetMapping("/findAll")
    public R findAllSocial(){
        List<SocialVo> slist = socialService.findAllSocial();
        return R.ok().data("list",slist);
    }

    @ApiOperation(value = "根据ID值查询社保")
    @GetMapping("/getIdSocial/{sid}")
    public R getIdSocial(
            @ApiParam(name = "sid", value = "社保ID", required = true)
            @PathVariable Integer sid){
        Social m = socialService.selectByPrimaryKey(sid);
        return R.ok().data("social",m);
    }

    @ApiOperation(value = "根据用户id值查询用户头像")
    @GetMapping("/getIdPic/{eid}")
    public R getIdPic(
            @ApiParam(name = "eid", value = "用户ID", required = true)
            @PathVariable Integer eid){
        ResumePicture p = socialService.selectByPIc(eid);
        return R.ok().data("p",p);
    }



}

